<template>
	<view class="content padding">
		<view class="color_six text_g">
			<u-parse :content="content"></u-parse>
		</view>
		<view class="flexcenter placeholderBoxTop" v-if="!content">
			<image class="placeholderBox" src="/static/placeholderimg.png" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				content: "",
				type: 1, //1关于我们，2用户协议，3隐私政策，4注销协议
				shopInfo:{}
			}
		},
		async onLoad(options) {
			this.type = options.type
			uni.setNavigationBarTitle({
				title: options.type == 1 ? '关于我们' : options.type == 2 ? '用户协议' : options.type == 3 ? '隐私政策' :
					'注销协议'
			});
			this.getSystem()
			// let res=await this.initApp()
			// this.shopInfo=res.data
		},
		// computed: {
		// 	content(){
		// 		if(this.type==1){
		// 			return this.shopInfo.sys_user_about
		// 		}else if(this.type==2){
		// 			return this.shopInfo.sys_user_agree
		// 		}else if(this.type==3){
		// 			return this.shopInfo.sys_user_privacy
		// 		}else{
		// 			return this.shopInfo.sys_user_cancel
		// 		}
		// 	},
		// },
		methods: {
			getSystem() {
				let _this = this
				httpRequest.request('/api/common/init', 'GET', {
					appform: 1,
					version: "1.0.0",
					platform: "android"
				}).then(res => {
					if (this.type == 1) {
						this.content = res.data.sys_user_about //关于我们
					}
					if (this.type == 2) {
						this.content = res.data.sys_user_agree //用户协议
					}
					if (this.type == 3) {
						this.content = res.data.sys_user_privacy //隐私政策
					}
					if (this.type == 4) {
						this.content = res.data.sys_user_cancel //注销协议
					}

				})
			},
		}
	}
</script>

<style lang="scss" scoped>

</style>